<?php
use app\data\StaffData;
$this->context->layout=false;

?>
<?php
//使用率
echo $this->render("@app/views/public/useRate.php")
?>
<form>
	<div style="margin:15px;">
		<div class="panel panel-default">
			<div class="panel-heading">职位资料</div>
			<div class="panel-body m-panel-body">
			  	<div class="m-box">
					<table class="table">
						<tr>
							<th width="20%">
								部门名称：
							</th>
							<td width="30%">
								<input type="text" class="k-input k-textbox" id="department_id" name="department_id" value="<?=$oData['department_name']; ?>">
							</td>
							<th width="20%">
								职位：
							</th>
							<td width="30%">
								<input type="text" class="k-input k-textbox" name="position_id" value="<?=$oData['position_name']; ?>">
							</td>
						</tr>

						<tr>
							<th>
								组别：
							</th>
							<td>
								<input type="text" class="k-input k-textbox" name="group_id" value="<?=$oData['group_name']; ?>">
							</td>
							<th>
								在职状态：
							</th>
							<td>
								<input type="text" class="k-input k-textbox" name="position_status" value="<?=StaffData::valueToText($oData['position_status'],StaffData::getPositionStatus()); ?>">
							</td>
						</tr>


						<tr>
							<th>
								入职日期：
							</th>
							<td>
								<input type="text" class="k-input k-textbox" name="hired_date" value="<?=date("m/d/Y",strtotime($oData['hired_date'])); ?>">
							</td>
							<th>
								指纹号：
							</th>
							<td>
								
								<input type="text" class="k-input k-textbox" name="finger_print_number" value="<?=$oData['finger_print_number']; ?>">
							</td>
						</tr>

						<tr>
							<th>
								合同状态
							</th>
							<td>
								<input type="text" class="k-input k-textbox" name="contract_status" value="<?=StaffData::valueToText($oData['contract_status'],StaffData::getContractStatus()); ?>">
							</td>
							<th>
								工作地点：
							</th>
							<td>
								<input type="text" class="k-input k-textbox" name="work_place" value="<?=$oData['work_place']; ?>">
							</td>
						</tr>

					</table>
				</div>
			</div>
		</div>
		<Br>
		<div class="panel panel-default">
			<div class="panel-heading">基本资料</div>
			<div class="panel-body m-panel-body">
			  	<div class="m-box">
					<table class="table">
						<tr>
							<th width="20%">
								中文名：
							</th>
							<td width="30%">
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=$oData['name_cn_long']; ?>">
							</td>
							<th width="20%">
								英文名：
							</th>
							<td width="30%">
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=$oData['name_en_long']; ?>">
							</td>
						</tr>

						<tr>
							<th>
								性别：
							</th>
							<td>
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=StaffData::valueToText($oData['gender'],StaffData::getGender()); ?>">
							</td>
							<th>
								婚姻状态：
							</th>
							<td>
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=StaffData::valueToText($oData['marital_status'],StaffData::getMarriage()); ?>">
							</td>
						</tr>

						<tr>
							<th>
								出生日期：
							</th>
							<td>
								
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=date("m/d/Y",strtotime($oData['dob'])); ?>">
							</td>
							<th>
								民族：
							</th>
							<td>
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=$oData['nation']; ?>">
							</td>
						</tr>


						<tr>
							<th>
								学历：
							</th>
							<td>
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=StaffData::valueToText($oData['education'],StaffData::getEducation()); ?>">
							</td>
							<th>
								毕业学校：
							</th>
							<td>
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=$oData['graduation_school']; ?>">
							</td>
						</tr>

						<tr>
							<th>
								专业：
							</th>
							<td>
								
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=$oData['major']; ?>">
							</td>
							<th>
								身份证号码：
							</th>
							<td>
								
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=$oData['identity_card_number']; ?>">
							</td>
						</tr>

						<tr>
							<th>
								联系电话：
							</th>
							<td>
								
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=$oData['phone_number']; ?>">
							</td>
							<th>
								邮件：
							</th>
							<td>
								
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=$oData['email']; ?>">
							</td>
						</tr>

						<tr>
							<th>
								政治地位：
							</th>
							<td>			
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=StaffData::valueToText($oData['political_status'],StaffData::getPoliticalStatus());?>">
							</td>
							<th>
								序列号：
							</th>
							<td>
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=$oData['serial_number']; ?>">
							</td>
						</tr>

						<tr>
							<th>
								家庭类型：
							</th>
							<td>
				
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=$oData['household_category']; ?>">					
							</td>
							<th>
								家庭住址：
							</th>
							<td>
								
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=$oData['household_location']; ?>">	
							</td>
						</tr>

						<tr>
							<th>
								银行名称：
							</th>
							<td>
								
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=$oData['bank_name']; ?>">							
							</td>
							<th>
								银行号码：
							</th>
							<td>
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=$oData['bank_number']; ?>">
							</td>
						</tr>

						<tr>
							<th>
								紧急联系人：
							</th>
							<td>
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=$oData['emergency_contact']; ?>">						
							</td>
							<th>
								紧急联系人号码：
							</th>
							<td>
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=$oData['emergency_contact_phone_number']; ?>">
							</td>
						</tr>

						<tr>
							<th>
								地址1：
							</th>
							<td colspan="3">
									
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=$oData['address1']; ?>" style="width:100%">						
							</td>
							
						</tr>
						<tr>
							<th>
								地址2：
							</th>
							<td colspan="3">
								
								<input type="text" class="k-input k-textbox" name="get_date_arr[]" value="<?=$oData['address2']; ?>" style="width:100%">
							</td>
						</tr>
						
					</table>
				</div>
			</div>
		</div>
		<br>
		<div class="panel panel-default">
			<div class="panel-heading">教育经历</div>
			<div class="panel-body m-panel-body">
			  	<div class="m-box">
			  		<div class="m-box">
			  			<a type="button" id="add-education" class="k-button k-button-icontext" href="javascript:;"><i class="glyphicon glyphicon-plus"></i>添加</a>
						<div id="education-box">

						</div>
					</div>
			  	</div>
			</div>
		</div>

		<br>
		<div class="panel panel-default">
			<div class="panel-heading">员工证书</div>
			<div class="panel-body m-panel-body">
			  	<div class="m-box">
			  		<div class="m-box">
			  			<a type="button" id="add-certificate" class="k-button k-button-icontext" href="javascript:;"><i class="glyphicon glyphicon-plus"></i>添加</a>
						<table class="table" id="certificate-table" style="margin-top:10px">
							
						</table>
			  	</div>
			</div>
		</div>
		<br>

		<div class="panel panel-default">
			<div class="panel-heading">家庭成员</div>
			<div class="panel-body m-panel-body">
			  	<div class="m-box">
			  		<div class="m-box">
			  			<a type="button" id="add-member" class="k-button k-button-icontext" href="javascript:;"><i class="glyphicon glyphicon-plus"></i>添加</a>
						<div id="member-box">

						</div>
			  	</div>
			</div>
		</div>
		<br>
		<div class="panel panel-default">
			<div class="panel-heading">工作经验</div>
			<div class="panel-body m-panel-body">
			  	<div class="m-box">
			  		<div class="m-box">
			  			<a type="button" id="add-word" class="k-button k-button-icontext" href="javascript:;"><i class="glyphicon glyphicon-plus"></i>添加</a>
						<div id="word-box">

						</div>
			  	</div>
			</div>
		</div>
	</div>
	<a type="button" class="k-button k-button-icontext" href="javascript:;" style="margin-top:20px;float:right;"><i class="glyphicon glyphicon-plus"></i>提交</a>
</form>
<script>
$(function(){

	//单选控件
	$("#department_id").kendoDropDownList({
        dataTextField: "text",
        dataValueField: "value",
        dataSource: new kendo.data.DataSource({
        transport: {
            read:  {
                url: "<?=Url::toReter(['/list/list']); ?>",
                dataType: "json"
            }
        },
        index: 0,
        change: onChange
    });


	$("#add-certificate").click(function(e){
		var _html = '<tr>\
			<th width="16%">\
				时间：\
			</th>\
			<td width="16%">\
				<input type="text" class="k-input k-textbox" name="get_date_arr[]" style="width:120px;">\
			</td>\
			<th width="16%">\
				名称：\
			</th>\
			<td width="16%">\
				<input type="text" class="k-input k-textbox" name="certificate_name_arr[]" style="width:120px;">\
			</td>\
			<th width="16%">\
				成绩：\
			</th>\
			<td width="16%">\
				<input type="text" class="k-input k-textbox" name="result_arr[]" style="width:120px;">\
			</td>\
			<td width="1%">\
				<a href="javascript:;" class="del-row"><i class="glyphicon glyphicon-remove"></i></a>\
			</td>\
		</tr>';

		$("#certificate-table").append(_html);

		$(".del-row").click(function(e){
			$(this).parents("tr").remove();
		})

	});

	$("#add-education").click(function(e){
		var _html = '<div class="row m-table-row" style="margin-top:10px;">\
			&nbsp;&nbsp;\
			<div class="label">开始时间</div>\
			&nbsp;&nbsp;\
			<input type="text" class="k-input k-textbox" name="start_date_arr[]" style="width:121px;float:left;">\
			&nbsp;&nbsp;\
			<div class="label">结束时间</div>\
			&nbsp;&nbsp;\
			<input type="text" class="k-input k-textbox" name="end_date_arr[]" style="width:121px;float:left;">\
			&nbsp;&nbsp;\
			<div class="label">教育机构</div>\
			&nbsp;&nbsp;\
			<input type="text" class="k-input k-textbox" name="education_organization_arr[]" style="width:121px;float:left;">\
			<br>\
			<br>\
			&nbsp;&nbsp;\
			<div class="label">专业</div>\
			&nbsp;&nbsp;\
			<input type="text" class="k-input k-textbox" name="major_arr[]" style="width:121px;float:left;">\
			&nbsp;&nbsp;\
			<div class="label">学历</div>\
			&nbsp;&nbsp;\
			<input type="text" class="k-input k-textbox" name="educational_arr[]" style="width:121px;float:left;">\
			&nbsp;&nbsp;\
			<a href="javascript:;" class="del-row"><i class="glyphicon glyphicon-remove"></i></a>\
		</div>';

		$("#education-box").append(_html);

		$(".del-row").click(function(e){
			$(this).parents(".m-table-row").remove();
		})
	});

	$("#add-member").click(function(e){
		var _html = '<div class="row m-table-row" style="margin-top:10px;">\
			&nbsp;&nbsp;\
			<div class="label">姓名</div>\
			&nbsp;&nbsp;\
			<input type="text" class="k-input k-textbox" name="member_name_arr[]" style="width:121px;float:left;">\
			&nbsp;&nbsp;\
			<div class="label">关系</div>\
			&nbsp;&nbsp;\
			<input type="text" class="k-input k-textbox" name="relationship_arr[]" style="width:121px;float:left;">\
			&nbsp;&nbsp;\
			<div class="label">工作单位</div>\
			&nbsp;&nbsp;\
			<input type="text" class="k-input k-textbox" name="work_unit_arr[]" style="width:121px;float:left;">\
			<br>\
			<br>\
			&nbsp;&nbsp;\
			<div class="label">职业</div>\
			&nbsp;&nbsp;\
			<input type="text" class="k-input k-textbox" name="member_position_name_arr[]" style="width:121px;float:left;">\
			&nbsp;&nbsp;\
			<div class="label">电话</div>\
			&nbsp;&nbsp;\
			<input type="text" class="k-input k-textbox" name="tel_arr[]" style="width:121px;float:left;">\
			&nbsp;&nbsp;\
			<a href="javascript:;" class="del-row"><i class="glyphicon glyphicon-remove"></i></a>\
		</div>';

		$("#member-box").append(_html);

		$(".del-row").click(function(e){
			$(this).parents(".m-table-row").remove();
		})
	})


	$("#add-word").click(function(e){
		var _html = '<div class="row m-table-row" style="margin-top:10px;">\
			&nbsp;&nbsp;\
			<div class="label">开始时间</div>\
			&nbsp;&nbsp;\
			<input type="text" class="k-input k-textbox" name="start_date_arr[]" style="width:121px;float:left;">\
			&nbsp;&nbsp;\
			<div class="label">结束时间</div>\
			&nbsp;&nbsp;\
			<input type="text" class="k-input k-textbox" name="end_date_arr[]" style="width:121px;float:left;">\
			&nbsp;&nbsp;\
			<div class="label">单位名称</div>\
			&nbsp;&nbsp;\
			<input type="text" class="k-input k-textbox" name="unit_name_arr[]" style="width:121px;float:left;">\
			<br>\
			<br>\
			&nbsp;&nbsp;\
			<div class="label">职位</div>\
			&nbsp;&nbsp;\
			<input type="text" class="k-input k-textbox" name="position_name_arr[]" style="width:121px;float:left;">\
			&nbsp;&nbsp;\
			<div class="label">离职原因</div>\
			&nbsp;&nbsp;\
			<input type="text" class="k-input k-textbox" name="leave_reason_arr[]" style="width:121px;float:left;">\
			&nbsp;&nbsp;\
			<a href="javascript:;" class="del-row"><i class="glyphicon glyphicon-remove"></i></a>\
		</div>';

		$("#word-box").append(_html);

		$(".del-row").click(function(e){
			$(this).parents(".m-table-row").remove();
		})
	})
})
</script>